<?php
    include 'mysqlconnect.php';
    $params = array(
        'hostname' => '127.0.0.1',
        'dbname' => 'level',
        'username' => 'root',
        'password' => ''
    );
    $connect = new mysqlconnect($params);
    $type = $_GET['type'];
    if ($type!='')
    {
        $connect->connect();
        $cases = $connect->fetch('SELECT * FROM news WHERE news_type=? ORDER BY news_date DESC',$type);
        echo json_encode($cases);
    }

?>
